package main.gui.action;

import java.awt.event.ActionEvent;
import java.io.IOException;

import javax.swing.AbstractAction;

import main.FileManager;
import main.Outputing;
import main.gui.App;

@SuppressWarnings("serial")
public class SaveAction extends AbstractAction {
  private final App app;

  public SaveAction(App app) {
    this.app = app;
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    try {
      new Outputing().fileOutput(app.getCurrentData(), new FileManager().askSourceFile());
    }
    catch (IOException e1) {
    }
  }
}
